package cn.huiyunche.base.service.vo;

import cn.huiyunche.base.service.handler.JsonDateSerializerByLine;
import cn.huiyunche.tools.basic.exceptions.BusinessException;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import java.io.Serializable;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @ClassName: OrderVo
 * @Description: TODO
 * @author: Aaron
 * @date: 2016年6月3日 上午11:18:44
 */
public class OrderVo implements Serializable {

    /**
     * @fieldName: serialVersionUID
     * @fieldType: long
     * @Description: TODO
     */
    private static final long serialVersionUID = 1725110344245171464L;

    /**
     * @fieldName: id
     * @fieldType: Long
     * @Description: TODO
     */
    private Long id;

    // 用户id
    private Long userId;

    /**
     * @fieldName: orderCode
     * @fieldType: String
     * @Description: 订单编号
     */
    private String orderCode;

    // 出发省
    private String departProvinceName;

    /**
     * @fieldName: departCityName
     * @fieldType: String
     * @Description: 出发城市
     */
    private String departCityName;

    /**
     * @fieldName: departUnit
     * @fieldType: String
     * @Description: 出发单位
     */
    private String departUnit;

    //发车联系人
    private String departContact;

    //发车联系人电话
    private String departPhone;

    //提车详细地址
    private String departAddr;

    // 到达省
    private String receiptProvinceName;

    /**
     * @fieldName: receiptCityName
     * @fieldType: String
     * @Description: 目的地城市
     */
    private String receiptCityName;

    /**
     * @fieldName: receiptUnit
     * @fieldType: String
     * @Description: 接收单位
     */
    private String receiptUnit;

    //收车联系人
    private String receiptContact;

    //收车联系人电话
    private String receiptPhone;

    //收车详细地址
    private String receiptAddr;

    //出发地地址
    private String depaAddr;

    //目的地地址
    private String destAddr;

    /**
     * @fieldName: deliveryDate
     * @fieldType: Date
     * @Description: 出发时间
     */
    @JsonSerialize(using = JsonDateSerializerByLine.class)
    private Date deliveryDate;

    //物流产品名称
    private String productName;

    /**
     * @fieldName: arriveDate
     * @fieldType: Date
     * @Description: 到达时间
     */
    @JsonSerialize(using = JsonDateSerializerByLine.class)
    private Date arriveDate;

    /**
     * @fieldName: unpaidCost
     * @fieldType: BigDecimal
     * @Description: 未付
     */
    private BigDecimal unpaidCost;

    /**
     * @fieldName: paidCost
     * @fieldType: BigDecimal
     * @Description: 已付
     */
    private BigDecimal paidCost;

    // 总费用
    private BigDecimal actualCost;

    //
    private BigDecimal orderCost;

    /**
     * @fieldName: status
     * @fieldType: Integer
     * @Description: 订单状态
     */
    private Integer status;

    /**
     * @fieldName: payStatus
     * @fieldType: Integer
     * @Description: 支付状态
     */
    private Integer payStatus;

    /**
     * @fieldName: statusText
     * @fieldType: String
     * @Description: 订单状态显示文本
     */
    private String statusText;

    /**
     * @fieldName: payStatusText
     * @fieldType: String
     * @Description: 付款状态显示文本
     */
    private String payStatusText;

    // 是否上门提车
    private Boolean isPick;

    // 是否送车上门
    private Boolean isDeliv;

    //是否是二手车
    private Boolean isSencondhand;

    //是否能动
    private Boolean isMobile;

    // 承运人信息
    private DriverInfo driverInfo;

    /**
     * @fieldName: vehicles
     * @fieldType: List<OrderDetail>
     * @Description: 客户订单详情（车辆信息）
     */
    private List<COrderDetailVo> vehicles = new ArrayList<COrderDetailVo>(0);

    /**
     * @fieldName: svehicles
     * @fieldType: List<SOrderDetailVo>
     * @Description: 客户订单车辆详情
     */
    private List<SOrderDetailVo> svehicles = new ArrayList<SOrderDetailVo>(0);

    // 车辆详情信息
    private String detail;

    /**
     * @fieldName: quoteCounts
     * @fieldType: int
     * @Description: 报价数
     */
    private int quoteCounts;

    /**
     * @fieldName: timeLeft
     * @fieldType: int
     * @Description: 过期剩余时间
     */
    private int postTimeRemaining;

    /**
     * 提车照片
     */
    private List<AttachVo> receiptPics = new ArrayList<AttachVo>(0);

    /**
     * 收车照片
     */
    private List<AttachVo> receivePics = new ArrayList<AttachVo>(0);

    //费用详情
    private List<SOrderFeeDetailVo> feeDetail = new ArrayList<>();

    //折扣相关信息
    private SOrderDiscountVo discount = new SOrderDiscountVo();

    //积分相关信息
    private QueryScoresVo scores = new QueryScoresVo();

    //整体估值
    private BigDecimal estValue;

    private Boolean isVeneer;

    //起始地区/县
    private String departCountyName;

    //目的地区/县
    private String receiptCountyName;

    //起始地省市(或市区)
    private String orgin;

    //目的地省市(或市区)
    private String dest;

    // 下单时间
    private Date createTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getOrderCode() {
        return orderCode;
    }

    public void setOrderCode(String orderCode) {
        this.orderCode = orderCode;
    }

    public String getDepartProvinceName() {
        return departProvinceName;
    }

    public void setDepartProvinceName(String departProvinceName) {
        this.departProvinceName = departProvinceName;
    }

    public String getDepartCityName() {
        return departCityName;
    }

    public void setDepartCityName(String departCityName) {
        this.departCityName = departCityName;
    }

    public String getDepartUnit() {
        return departUnit;
    }

    public void setDepartUnit(String departUnit) {
        this.departUnit = departUnit;
    }

    public String getDepartContact() {
        return departContact;
    }

    public void setDepartContact(String departContact) {
        this.departContact = departContact;
    }

    public String getDepartPhone() {
        return departPhone;
    }

    public void setDepartPhone(String departPhone) {
        this.departPhone = departPhone;
    }

    public String getDepartAddr() {
        return departAddr;
    }

    public void setDepartAddr(String departAddr) {
        this.departAddr = departAddr;
    }

    public String getReceiptProvinceName() {
        return receiptProvinceName;
    }

    public void setReceiptProvinceName(String receiptProvinceName) {
        this.receiptProvinceName = receiptProvinceName;
    }

    public String getReceiptCityName() {
        return receiptCityName;
    }

    public void setReceiptCityName(String receiptCityName) {
        this.receiptCityName = receiptCityName;
    }

    public String getReceiptUnit() {
        return receiptUnit;
    }

    public void setReceiptUnit(String receiptUnit) {
        this.receiptUnit = receiptUnit;
    }

    public String getReceiptContact() {
        return receiptContact;
    }

    public void setReceiptContact(String receiptContact) {
        this.receiptContact = receiptContact;
    }

    public String getReceiptPhone() {
        return receiptPhone;
    }

    public void setReceiptPhone(String receiptPhone) {
        this.receiptPhone = receiptPhone;
    }

    public String getReceiptAddr() {
        return receiptAddr;
    }

    public void setReceiptAddr(String receiptAddr) {
        this.receiptAddr = receiptAddr;
    }

    public String getDepaAddr() {
        return depaAddr;
    }

    public void setDepaAddr(String depaAddr) {
        this.depaAddr = depaAddr;
    }

    public String getDestAddr() {
        return destAddr;
    }

    public void setDestAddr(String destAddr) {
        this.destAddr = destAddr;
    }

    public Date getDeliveryDate() {
        return deliveryDate;
    }

    public void setDeliveryDate(Date deliveryDate) {
        this.deliveryDate = deliveryDate;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public Date getArriveDate() {
        return arriveDate;
    }

    public void setArriveDate(Date arriveDate) {
        this.arriveDate = arriveDate;
    }

    public BigDecimal getUnpaidCost() {
        return unpaidCost;
    }

    public void setUnpaidCost(BigDecimal unpaidCost) {
        this.unpaidCost = unpaidCost;
    }

    public BigDecimal getPaidCost() {
        return paidCost;
    }

    public void setPaidCost(BigDecimal paidCost) {
        this.paidCost = paidCost;
    }

    public BigDecimal getActualCost() {
        return actualCost;
    }

    public void setActualCost(BigDecimal actualCost) {
        this.actualCost = actualCost;
    }

    public BigDecimal getOrderCost() {
        return orderCost;
    }

    public void setOrderCost(BigDecimal orderCost) {
        this.orderCost = orderCost;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getPayStatus() {
        return payStatus;
    }

    public void setPayStatus(Integer payStatus) {
        this.payStatus = payStatus;
    }

    public String getStatusText() {
        return statusText;
    }

    public void setStatusText(String statusText) {
        this.statusText = statusText;
    }

    public String getPayStatusText() {
        return payStatusText;
    }

    public void setPayStatusText(String payStatusText) {
        this.payStatusText = payStatusText;
    }

    public Boolean getIsPick() {
        return isPick;
    }

    public void setIsPick(Boolean isPick) {
        this.isPick = isPick;
    }

    public Boolean getIsDeliv() {
        return isDeliv;
    }

    public void setIsDeliv(Boolean isDeliv) {
        this.isDeliv = isDeliv;
    }

    public Boolean getIsSencondhand() {
        return isSencondhand;
    }

    public void setIsSencondhand(Boolean isSencondhand) {
        this.isSencondhand = isSencondhand;
    }

    public Boolean getIsMobile() {
        return isMobile;
    }

    public void setIsMobile(Boolean isMobile) {
        this.isMobile = isMobile;
    }

    public DriverInfo getDriverInfo() {
        return driverInfo;
    }

    public void setDriverInfo(DriverInfo driverInfo) {
        this.driverInfo = driverInfo;
    }

    public List<COrderDetailVo> getVehicles() {
        return vehicles;
    }

    public void setVehicles(List<COrderDetailVo> vehicles) {
        this.vehicles = vehicles;
    }

    public List<SOrderDetailVo> getSvehicles() {
        return svehicles;
    }

    public void setSvehicles(List<SOrderDetailVo> svehicles) {
        this.svehicles = svehicles;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    public int getQuoteCounts() {
        return quoteCounts;
    }

    public void setQuoteCounts(int quoteCounts) {
        this.quoteCounts = quoteCounts;
    }

    public int getPostTimeRemaining() {
        return postTimeRemaining;
    }

    public void setPostTimeRemaining(int postTimeRemaining) {
        this.postTimeRemaining = postTimeRemaining;
    }

    public List<AttachVo> getReceiptPics() {
        return receiptPics;
    }

    public void setReceiptPics(List<AttachVo> receiptPics) {
        this.receiptPics = receiptPics;
    }

    public List<AttachVo> getReceivePics() {
        return receivePics;
    }

    public void setReceivePics(List<AttachVo> receivePics) {
        this.receivePics = receivePics;
    }

    public List<SOrderFeeDetailVo> getFeeDetail() {
        return feeDetail;
    }

    public void setFeeDetail(List<SOrderFeeDetailVo> feeDetail) {
        this.feeDetail = feeDetail;
    }

    public SOrderDiscountVo getDiscount() {
        return discount;
    }

    public void setDiscount(SOrderDiscountVo discount) {
        this.discount = discount;
    }

    public QueryScoresVo getScores() {
        return scores;
    }

    public void setScores(QueryScoresVo scores) {
        this.scores = scores;
    }

    public BigDecimal getEstValue() {
        return estValue;
    }

    public void setEstValue(BigDecimal estValue) {
        this.estValue = estValue;
    }

    public Boolean getIsVeneer() {
        return isVeneer;
    }

    public void setIsVeneer(Boolean isVeneer) {
        this.isVeneer = isVeneer;
    }

    public String getOrgin() {
        return orgin;
    }

    public void setOrgin(String orgin) {
        this.orgin = orgin;
    }

    public String getDest() {
        return dest;
    }

    public void setDest(String dest) {
        this.dest = dest;
    }

    public String getDepartCountyName() {
        return departCountyName;
    }

    public void setDepartCountyName(String departCountyName) {
        this.departCountyName = departCountyName;
    }

    public String getReceiptCountyName() {
        return receiptCountyName;
    }

    public void setReceiptCountyName(String receiptCountyName) {
        this.receiptCountyName = receiptCountyName;
    }

    public String getCreateTime() {
        SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
        try {
            return sf.format(createTime == null ? new Date() : createTime);
        } catch (Exception e) {
            throw new BusinessException("下单时间格式化异常");
        }
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return "OrderVo [id=" + id + ", userId=" + userId + ", orderCode=" + orderCode + ", departProvinceName="
                + departProvinceName + ", departCityName=" + departCityName + ", departUnit=" + departUnit
                + ", departContact=" + departContact + ", departPhone=" + departPhone + ", departAddr=" + departAddr
                + ", receiptProvinceName=" + receiptProvinceName + ", receiptCityName=" + receiptCityName
                + ", receiptUnit=" + receiptUnit + ", receiptContact=" + receiptContact + ", receiptPhone="
                + receiptPhone + ", receiptAddr=" + receiptAddr + ", depaAddr=" + depaAddr + ", destAddr=" + destAddr
                + ", deliveryDate=" + deliveryDate + ", productName=" + productName + ", arriveDate=" + arriveDate
                + ", unpaidCost=" + unpaidCost + ", paidCost=" + paidCost + ", actualCost=" + actualCost
                + ", orderCost=" + orderCost + ", status=" + status + ", payStatus=" + payStatus + ", statusText="
                + statusText + ", payStatusText=" + payStatusText + ", isPick=" + isPick + ", isDeliv=" + isDeliv
                + ", isSencondhand=" + isSencondhand + ", isMobile=" + isMobile + ", driverInfo=" + driverInfo
                + ", vehicles=" + vehicles + ", svehicles=" + svehicles + ", detail=" + detail + ", quoteCounts="
                + quoteCounts + ", postTimeRemaining=" + postTimeRemaining + ", receiptPics=" + receiptPics
                + ", receivePics=" + receivePics + ", feeDetail=" + feeDetail + ", discount=" + discount + ", scores="
                + scores + ", estValue=" + estValue + "]";
    }
}